import { Component, OnInit } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';

@Component({
  selector: 'app-contacts-create',
  templateUrl: './contacts-create.component.html',
  styleUrls: ['./contacts-create.component.scss'],
})
export class ContactsCreateComponent implements OnInit {

  returnUrl: string;

  username: string;

  constructor(private activatedRoute: ActivatedRoute, private router: Router) { }

  ngOnInit() {
    this.returnUrl = this.activatedRoute.snapshot.queryParams['returnUrl']
    this.username = 'hncszhangcong'
  }

  goback() {
    if (!this.returnUrl) {
      this.returnUrl = '/tabs/address-book'
    }
    console.log(this.returnUrl)
    this.router.navigate([this.returnUrl])
  }
}
